home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -seriously_amiga- / programming / e / unfinishedesrc / tools.e < prev    next >
Text File  |  1999-01-25  |  2KB  |  75 lines

  1. ->By Ian Chapman
  2. ->Parses the toolsdaemon Menu File.
  3. ->I originally intended to write a replacement toolsdaemon prefs prog
  4. ->Note, this program opens a huge window in excess of 1000x760
  5. ->Either run in a larger screen mode or alter the window size.
  6. ->NB There is no checking to see whether all the text will fit on the window, so
  7. ->it may crash if it writes ourside of the window rastport
  8.  
  9. MODULE  'DOS/DOS',
  10.         'intuition/intuition'
  11.  
  12.  
  13. PROC main()
  14. DEF fh,line[200]:STRING,cola,colb,colc,win,choppedline[200]:STRING,pos
  15.  
  16. cola:=30
  17. colb:=30
  18. colc:=30
  19.  
  20.  
  21.  
  22. IF (fh:=Open('S:toolsdaemon.menu',MODE_OLDFILE))<>NIL
  23.     IF (win:=OpenW(0,0,1000,760,IDCMP_CLOSEWINDOW,WFLG_DRAGBAR,'ToolsDaemon Inserter',NIL,1,NIL))<>NIL
  24.         Colour(1)
  25.         TextF(30,cola,'MENU NAMES')
  26.         TextF(260,colb,'PROGRAM NAMES')
  27.         TextF(480,colc,'PROGRAM PATH')
  28.         REPEAT
  29.             Fgets(fh,line,ALL)
  30.             StrCopy(line,line,(StrLen(line)-1))
  31.  
  32.             IF (pos:=InStr(line,'TITLE',0))>-1
  33.                 StrCopy(line,MidStr(line,line,pos+6,ALL),ALL)
  34.                 cola:=cola+10
  35.                 TextF(30,cola,line)
  36.             ENDIF
  37.  
  38.             IF (pos:=InStr(line,'SUB',0))>-1
  39.                 StrCopy(line,MidStr(line,line,pos+4,ALL),ALL)
  40.                 colb:=colb+10
  41.                 TextF(260,colb,line)
  42.             ENDIF
  43.  
  44.             IF (pos:=InStr(line,'(WB)',0))>-1
  45.                 StrCopy(line,MidStr(line,line,pos+5,ALL),ALL)
  46.                 colc:=colc+10
  47.                 TextF(480,colc,line)
  48.             ENDIF
  49.  
  50.             IF (pos:=InStr(line,'(CLI)',0))>-1
  51.                 StrCopy(line,MidStr(line,line,pos+6,ALL),ALL)
  52.                 colc:=colc+10
  53.                 TextF(480,colc,line)
  54.             ENDIF
  55.  
  56.         UNTIL InStr(line,'END',0)=0
  57.  
  58.         Delay(500)
  59.  
  60.         CloseW(win)
  61.  
  62.     ELSE
  63.         PrintF('Unable to open window!\n')
  64.     ENDIF
  65.  
  66.     Close(fh)
  67.  
  68. ELSE
  69.     PrintF('Unable to open S:toolsdaemon.menu!\n')
  70. ENDIF
  71.  
  72. ENDPROC
  73.  
  74.  
  75.